<script >
import Content from './components/Content.vue'


export default {
  data() {
    return {
      message: ""
    }
  },
  components: {
    Content,
  },
  methods: {
    getContent(value) {
      console.log(value);
      this.message = value
    }
  }
}
</script>

<template>
  <h1>{{message}}</h1>
  <!-- 通过自定义事件拿到子组件数据 -->
  <!-- 2、在父组件中，通过v-on监听子组件中自定义事件injectMsg -->
  <Content @injectMsg="getContent" />
</template>

<style scoped>

</style>
